package cn.iocoder.yudao.module.ad.framework.core.enums.channel;

import cn.hutool.core.util.ArrayUtil;
import cn.iocoder.yudao.module.ad.framework.core.channel.AdChannelClient;
import cn.iocoder.yudao.module.ad.framework.core.channel.impl.FeiYuChannelClient;
import cn.iocoder.yudao.module.ad.framework.core.channel.impl.KwaiShowChannelClient;
import cn.iocoder.yudao.module.ad.framework.core.channel.impl.LkChannelClient;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 支付渠道的编码的枚举
 *
 * @author 芋道源码
 */
@Getter
@AllArgsConstructor
public enum AdChannelEnum {

    DOU_YIN_LAI_KE("DOU_YIN_LAI_KE", "抖音来客", LkChannelClient.class),
    KUAI_SHOU_CI_LI("KUAI_SHOU_CI_LI", "快手-磁力引擎", KwaiShowChannelClient.class),
    DOU_YIN_FEI_YU("DOU_YIN_FEI_YU", "抖音-飞鱼", FeiYuChannelClient.class),

//    LEGAL_ADVICE_MP("LEGAL_ADVICE_MP", "法律咨询小程序", FeiYuChannelClient.class),

    ;
    /**
     * 编码
     */
    private final String code;
    /**
     * 名字
     */
    private final String name;

    /**
     * 配置类
     */
    private final Class<? extends AdChannelClient> mediaClass;


    public static AdChannelEnum getByCode(String code) {
        return ArrayUtil.firstMatch(o -> o.getCode().equals(code), values());
    }

}
